#ifndef __C_GUI_ICON_FACTORY_H_INCLUDED__
#define __C_GUI_ICON_FACTORY_H_INCLUDED__

#include "IGUIElementFactory.h"

#include "EGUIIconFactoryEnums.h"

// include element types created by the factory
#include "CGUIIcon.h"
#include "CGUIIconSlot.h"
#include "CGUISlotWindow.h"
// #include "CGUIListView.h"
// #include "CGUITreeView.h"

namespace irr
{
namespace gui
{
	class IGUIEnvironment;
	
	//!	Factory containing GUI Icons and elements which use them
	class CGUIIconFactory : public IGUIElementFactory
	{
	public:

		//! constructor
		CGUIIconFactory(IGUIEnvironment *env);

		//! adds an element to the gui environment based on its type id
		virtual IGUIElement* addGUIElement(EGUI_ELEMENT_TYPE type, IGUIElement* parent=0);

		//! adds a GUI element to the GUI Environment based on its type name
		virtual IGUIElement* addGUIElement(const c8* typeName, IGUIElement* parent=0);

		//! returns amount of GUI element types this factory is able to create
		virtual s32 getCreatableGUIElementTypeCount();

		//! returns type of a createable element type
		virtual EGUI_ELEMENT_TYPE getCreateableGUIElementType(s32 idx);

		//! returns type name of a createable GUI element type by index
		virtual const c8* getCreateableGUIElementTypeName(s32 idx);

		//! returns type name of a createable GUI element
		virtual const c8* getCreateableGUIElementTypeName(EGUI_ELEMENT_TYPE type);

		//! gets the element type from the name
		EGUI_ICON_FACTORY_ELEMENT_TYPE getTypeFromName(const c8* typeName);



		//! Adds a draggable, clickable icon
		CGUIIcon* addIcon( core::position2di pos, IGUIElement* parent=0,
			IGUISpriteBank* sprites=0, wchar_t* iconText=0, s32 id=-1);

		//! Adds an icon slot capable of holding an icon
		CGUIIconSlot* addIconSlot( core::rect<s32> rect, s32 slotGroupID=-1, IGUIElement *parent=0, s32 id=-1);

	private:

		//! maps EGUI_ICON_FACTORY_ELEMENT_TYPE to their index
		EGUI_ICON_FACTORY_ELEMENT_TYPE IndexMap[EGIEFT_COUNT];

		//! gui environment pointer
		IGUIEnvironment *Environment;

	};


} // end namespace gui
} // end namespace irr

#endif // __I_GUI_ELEMENT_FACTORY_H_INCLUDED__
